//
//  ZZTableViewModel.m
//  zhengzai-tv
//
//  Created by SC on 16/6/20.
//  Copyright © 2016年 zhengzai.tv. All rights reserved.
//

#import "ZZTableViewModel.h"

@implementation ZZTableViewModel

- (void)didSelectRowAtIndexPath:(NSIndexPath *)indexPath {}

- (void)requestRemoteData
{
    [self requestRemoteDataWithPage:1];
}

- (void)requestRemoteDataWithPage:(NSInteger)page {}


- (void)endRefresh
{
    
    if (self.ownerTableView.mj_footer) {
        if (self.dataSource.count > 0) {
            if ([self.dataSource[0] count] >= 10) {
                self.ownerTableView.mj_footer.hidden = NO;
            }else
            {
                self.ownerTableView.mj_footer.hidden = YES;
            }
        }
    }
    
    
    if (self.ownerTableView.mj_header && self.ownerTableView.mj_header.isRefreshing) {
        [self.ownerTableView.mj_header endRefreshing];
        if ([self.dataSource[0] count] >= self.total) {
            [self.ownerTableView.mj_footer endRefreshingWithNoMoreData];
        }
    }
    
    
    if (self.ownerTableView.mj_footer && self.ownerTableView.mj_footer.isRefreshing) {
        if ([self.dataSource[0] count] >= self.total) {
            [self.ownerTableView.mj_footer endRefreshingWithNoMoreData];
        }else
        {
            [self.ownerTableView.mj_footer endRefreshing];
        }
    }
    
    
}


@end
